package cn.lijida.weiwei.favor.modules.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.lijida.weiwei.favor.commons.utils.ReturnT;
import cn.lijida.weiwei.favor.modules.member.service.IFavorMemberService;
import cn.lijida.weiwei.favor.modules.sys.bo.LoginBO;
import cn.lijida.weiwei.favor.modules.sys.service.IFavorTokenService;
import cn.lijida.weiwei.favor.modules.sys.vo.LoginVO;

@RestController
@RequestMapping("/sys/login")
public class LoginController {
	
	@Autowired
	IFavorMemberService memberService;
	
	@Autowired
	IFavorTokenService tokenService;

	/**  
	 * <p>Title: memberLogin</p>  
	 * <p>Description: 成员登录</p>  
	 * @param login
	 * @return
	 * @throws Exception  
	 */  
	@PostMapping("/member")
	public ReturnT<LoginVO> memberLogin(@RequestBody @Validated LoginBO login) throws Exception{
		
		LoginVO data = memberService.login(login);
		ReturnT<LoginVO> r = new ReturnT<LoginVO>(data);
		return r;
	}
}
